html, body {
	margin: 0;
	padding: 0;
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	color: #333;
	background-color: #fbfbfb;
	height: 100%;
	overflow: auto;
}

textarea {
	font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
	font-size: 12px;
	resize: none;
}

header {
	padding-top: 10px;
	display: flex;
	align-items: center;
	height: 58px;
	padding-inline-end: 70px;
}

header h1 {
	margin: 0;
}

.other-demos {
	margin-left: 3em;
	flex-grow: 1;
}

.theme-toggle {
	margin-left: auto;
}

.containers {
	display: flex;
	height: calc(100vh - 68px);
}

.container {
	flex-basis: 50%;
	padding: 5px;
	display: flex;
	flex-direction: column;
	height: 100%;
	box-sizing: border-box;
}

.pane, .inputPane {
	margin-top: 5px;
	padding: 0.6em;
	border: 1px solid #ccc;
	overflow: auto;
	flex-grow: 1;
	flex-shrink: 1;
}

#preview {
	display: flex;
}

#preview iframe {
	flex-grow: 1;
}

#main {
	display: none;
}

.error {
	border-color: red;
	background-color: #FEE
}

.loadingError {
	background-color: #fee;
	font-weight: bold;
	color: #f00;
	text-align: center;
	padding: 10px;
}

#responseTime {
    display: inline-block;
}

/* Dark mode styles */
[data-theme="dark"] {
	color-scheme: dark;
	--github-corner-fill: #f0f6fc;
	--github-corner-color: #0d1117;
}

[data-theme="dark"] html,
[data-theme="dark"] body {
	color: #e6edf3;
	background-color: #0d1117;
}

[data-theme="dark"] .pane,
[data-theme="dark"] .inputPane {
	background-color: #161b22;
	border-color: #30363d;
	color: #e6edf3;
}

[data-theme="dark"] .label {
	color: #e6edf3;
}

[data-theme="dark"] select,
[data-theme="dark"] button:not(.theme-toggle) {
	background-color: #21262d;
	color: #e6edf3;
	border-color: #30363d;
}

[data-theme="dark"] .error {
	background-color: #3d1014;
	border-color: #67060c;
}

[data-theme="dark"] .loadingError {
	background-color: #3d1014;
	color: #ff7b72;
}

/* Auto mode with system preference */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--github-corner-fill: #f0f6fc;
		--github-corner-color: #0d1117;
	}

	:root:not([data-theme="light"]) html,
	:root:not([data-theme="light"]) body {
		color: #e6edf3;
		background-color: #0d1117;
	}

	:root:not([data-theme="light"]) .pane,
	:root:not([data-theme="light"]) .inputPane {
		background-color: #161b22;
		border-color: #30363d;
		color: #e6edf3;
	}

	:root:not([data-theme="light"]) .label {
		color: #e6edf3;
	}

	:root:not([data-theme="light"]) select,
	:root:not([data-theme="light"]) button:not(.theme-toggle) {
		background-color: #21262d;
		color: #e6edf3;
		border-color: #30363d;
	}

	:root:not([data-theme="light"]) .error {
		background-color: #3d1014;
		border-color: #67060c;
	}

	:root:not([data-theme="light"]) .loadingError {
		background-color: #3d1014;
		color: #ff7b72;
	}
}
